﻿using System.Web.Mvc;
using System.Web.Routing;

namespace NewsPortal.Web
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            //routes.MapRoute(
            //    name: "Default",
            //    url: "{controller}/{action}",
            //    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            //);

            routes.MapRoute(
                  name: "default",
                  url: "{Culture}/{controller}/{action}",
                  defaults: new { Culture = "fa", controller = "Home", action = "Index" }
              );

            routes.MapRoute(
                  name: "ModuleRoute",
                  url: "{Culture}/Modules/{ModuleName}/{ActionName}",
                  defaults: new { controller = "ModuleRouter", action = "Index" }
              );
        }
    }
}
